home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / mapsrc.lha / macros / decback < prev    next >
Encoding:
Text File  |  1980-02-19  |  286 b   |  21 lines

  1.  
  2. decback macro                ;converts ascii to decimal
  3.  
  4.                     ;A0 = Source, must end with an
  5.                     ;     illegal char. eg 0
  6.  
  7.                     ;D0 = Answer
  8.     moveq #0,d0
  9.     moveq #0,d1
  10. .\@hloop
  11.     move.b (a0)+,d1
  12.     sub.b #"0",d1
  13.     cmp.b #10,d1
  14.     bcc .\@decinok
  15.     mulu #10,d0
  16.     add.b d1,d0
  17.     bra .\@hloop
  18. .\@decinok
  19.  
  20.     endm
  21.